package com.program.facesigninsystem.service.impl;

import com.program.facesigninsystem.dao.ISignInActivityDao;
import com.program.facesigninsystem.entity.SignInActivity;
import com.program.facesigninsystem.entity.SignInLink;
import com.program.facesigninsystem.service.ISignInActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SignInActivityService implements ISignInActivityService {
    @Autowired
    private ISignInActivityDao iSignInActivityDao;

    @Override
    public void addNewActivity(String actId, String title, String createTime, String actType,String caption, String cid, String tid) {
        iSignInActivityDao.addNewActivity(actId,title,createTime,actType,caption,cid,tid);
    }

    @Override
    public void addNewLink(String lid, int linkType,String duration, String startTime, String endTime, int status, String actId,double location_x, double location_y, double range) {
        iSignInActivityDao.addNewLink(lid,linkType,duration,startTime,endTime,status,actId,location_x,location_y,range);
    }

    @Override
    public void updateLinkStatus(String lid, int status, String startTime, String endTime) {
        iSignInActivityDao.updateLinkStatus(lid,status,startTime,endTime);
    }

    @Override
    public Object[] selectActivityByTid(String tid,String createTime) {
        return iSignInActivityDao.selectActivityByTid(tid,createTime);
    }

    @Override
    public List<SignInActivity> selectActivityByMonth(String tid, String createTime) {
        return iSignInActivityDao.selectActivityByMonth(tid,createTime);
    }

    @Override
    public Object[] selectLinkByActId(String actId) {
        return iSignInActivityDao.selectLinkByActId(actId);
    }

    @Override
    public Object[] selectLinkByActId(String actId,int pageSize,int pageNum) {
        //PageHelper.startPage(pageSize, pageNum);
        return iSignInActivityDao.selectLinkByActId(actId);
    }

    @Override
    public void deleteActivityByID(String actId) {
        iSignInActivityDao.deleteActivityByID(actId);
    }

    @Override
    public SignInActivity selectAct(String lid) {
        return iSignInActivityDao.selectAct(lid);
    }

    @Override
    public SignInLink selectLinkByLid(String lid) {
        return iSignInActivityDao.selectLinkByLid(lid);
    }

    @Override
    public List<Map<String, Object>> selectList(String tid) {
        return iSignInActivityDao.selectList(tid);
    }

    @Override
    public List<SignInLink> selectLinkList(String actid) {
        return iSignInActivityDao.selectLinkList(actid);
    }
}
